import axios from '@/utils/axios';

export const getOrderPage = (params) => {
    return axios.request({
        url: '/order/page',
        method: 'get',
        params
    });
};

export const getOrder = (params) => {
    return axios.request({
        url: '/order/' + params.siteId + '/' + params.orderId,
        method: 'get'
    });
};

export const getOrderRecallPage = (params) => {
    return axios.request({
        url: '/order/recall/page',
        method: 'get',
        params
    });
};

export const addOrderLogistics = (data) => {
    return axios.request({
        url: '/order/',
        method: 'post',
        data
    });
};

export const orderRecall = (data) => {
    return axios.request({
        url: '/order/recall',
        method: 'post',
        data
    });
};

export const confirmOrderLogistics = (orderId, logisticsId) => {
    return axios.request({
        url: '/order/' + orderId + '/logistics/confirm/' + logisticsId,
        method: 'put'
    });
};

export const getAllOrderPage = (params) => {
    return axios.request({
        url: '/manager/order/page',
        method: 'get',
        params
    });
};

export const confirmEmail = (orderId) => {
    return axios.request({
        url: `/order/confirm-email/${orderId}`,
        method: 'get'
    });
};
